package book.servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import book.dto.Page;
import book.entity.Category;
import book.service.BookService;
import book.service.CategoryService;
import book.service.impl.BookServiceImpl;
import book.service.impl.CategoryServiceImpl;

/**
 * Servlet implementation class BookgetListServlet
 */
public class BookgetListServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

    BookService bookService = new BookServiceImpl();
    
    CategoryService categoryService = new CategoryServiceImpl();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		/*
		 * int pageNO = 1; int pageSize = 2;
		 * 
		 * try {
		 * 
		 * Page page = bookService.getBookList(pageNO, pageSize);
		 * 
		 * List<Category> categoryList = categoryService.getCategoryList();
		 * 
		 * System.out.println(categoryList);
		 * 
		 * // categoryService.getCategory(categoryId);
		 * 
		 * 
		 * request.setAttribute("categoryList", categoryList);
		 * request.setAttribute("page", page);
		 * 
		 * 
		 * 
		 * 
		 * 
		 * } catch (SQLException e) { // TODO Auto-generated catch block
		 * e.printStackTrace(); }
		 */
		
		
		
		
		request.getRequestDispatcher("/book_list.jsp").forward(request, response);
		
		
	}

}
